﻿@using Microsoft.Web.Helpers

@model ThienVienDiDaTu.Models.AnPham

@{
    ViewBag.Title = "ApCreat";
}

<h2>ApCreat</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("ApCreat", "Admin", FormMethod.Post, new { @enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>AnPham</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.TenAnPham)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TenAnPham)
            @Html.ValidationMessageFor(model => model.TenAnPham)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TacGia)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.TacGia)
            @Html.ValidationMessageFor(model => model.TacGia)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TomTat)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.TomTat)
            @Html.ValidationMessageFor(model => model.TomTat)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.DonViPhatHanh)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.DonViPhatHanh)
            @Html.ValidationMessageFor(model => model.DonViPhatHanh)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Gia)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Gia)
            @Html.ValidationMessageFor(model => model.Gia)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LinkAnh)
        </div>
        @FileUpload.GetHtml(initialNumberOfFiles: 1, allowMoreFilesToBeAdded: false, includeFormTag: false, addText: "Thêm ảnh", uploadText: "Upload ảnh")
            

        <p>
            <input type="submit" value="Tạo mới" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Trở lại danh sách", "ApList")
</div>

